package org.softmed.rest.admin.config;

import java.awt.Dimension;

import javax.swing.Box;
import javax.swing.BoxLayout;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;

public class ConfigurationPathHandler extends JPanel {

	JTextField pathField = new JTextField();

	int width = 540;
	int height = 25;

	public ConfigurationPathHandler() {

		// pathField.addKeyListener(this);
		// pathField.getDocument().addDocumentListener(this);

		setLayout(new BoxLayout(this, BoxLayout.LINE_AXIS));
		// setBackground(Color.RED);

		setPreferredSize(new Dimension(width, height));
		setMaximumSize(new Dimension(width, height));
		setMinimumSize(new Dimension(width, height));

		pathField.setPreferredSize(new Dimension(width - 120, height));
		pathField.setMaximumSize(new Dimension(width - 120, height));
		pathField.setMinimumSize(new Dimension(width - 120, height));

		add(new JLabel("Config file path:"));
		add(pathField);
		add(Box.createHorizontalGlue());

	}

	public void setText(String path) {
		pathField.setText(path);
	}

	public String getText() {
		return pathField.getText();
	}

}
